import {IAddress} from "@/store/myModule/types";

interface IOrderItemVo {
    "id": number
    "userId": number
    "orderNO": string
    "productId": number
    "productName": string
    "productImage": string
    "currentUnitPrice": number
    "quantity": number
    "totalPrice": number
    "productSpecs": any
}

interface IOrderDetail {
    address?: IAddress
    createTime?: string
    orderNo: string
    payment?: number // 总价格
    paymentTime?: string
    paymentType: number
    status: number
    userId?: number
    sysOrderItemsVo?: Array<IOrderItemVo>
}

interface IOrderListPageInfo {
    pageSize: number
    pageNum: number
    pageTotal: number
}

export interface IOrderList {
    id: number
    orderNo: string
    userId: number
    address: Address
    sysOrderItemsVo: SysOrderItemsVo[]
    payment: number
    paymentType: number
    postage: any
    status: number
    paymentTime: any
    sendTime: any
    endTime: any
    closeTime: any
    createTime: string
}

export interface Address {
    id: number
    userId: number
    receiverName: string
    receiverPhone: any
    receiverMobile: string
    receiverProvince: number
    receiverCity: number
    receiverDistrict: number
    receiverAddress: string
    receiverZip: any
    receiverDefault: number
}

export interface SysOrderItemsVo {
    id: number
    userId: number
    orderNO: string
    productId: number
    productName: string
    productImage: string
    currentUnitPrice: number
    quantity: number
    totalPrice: number
    productSpecs: any
}


export interface IState {
    currentOrderDetail: IOrderDetail
    orderList: Array<IOrderList>
    orderListPageInfo: IOrderListPageInfo
}

interface IBaseForm {
    pageSize?: number
    pageNumber?: number
    searchCtt?: string
}

interface IDetailParams {
    orderNo?: number
}

interface IGetOrderDetailParams extends IDetailParams {
}

interface ISetOrderDetailParams extends IDetailParams {
}

interface IOrderListParams {
    needToken?: boolean
    needNavigate?: string
    form?: IBaseForm
    isMoreMode?: boolean
}

interface IGetOrderListAction extends IOrderListParams {

}

interface ISetOrderListAction extends IOrderListParams {

}

interface IDeleteOrderParams {
    orderNo: string
}

export interface IActions {
    getOrderDetailAction: (params: IGetOrderDetailParams) => Promise<any>
    setOrderDetailAction: (params: ISetOrderDetailParams) => Promise<boolean>
    getOrderListAction: (params: IGetOrderListAction) => Promise<any>
    setOrderListAction: (params: ISetOrderListAction) => Promise<boolean>
    deleteOrderAction: (params: IDeleteOrderParams) => Promise<boolean>
}
